<template>
    <div>
        <h1>用户投资明细</h1>
        <table class="table table-bordered" border="1">
            <thead>
                <tr>
                    <th>投资人账号</th>
                    <th>投资金额</th>
                    <th>投资时间</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="item in info " :key="item.I_Id">
                    <td>{{item.UL_Name}}</td>
                    <td>{{item.UI_Money}}</td>
                    <td>{{item.UI_Date.substring(0,10)}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import { ref,onMounted } from 'vue';
import axios from 'axios';

const info :any = ref([]);


const route = useRoute();

const id = route.params.id;
console.log(id);

onMounted(()=>{
    Updshow();

})




const Updshow = ()=>{
    axios({
        method:'get',
        url:'http://localhost:57969/api/Invest/ShowInvestInfo2',
        params:{
            iid:id,
        }
    })
    .then(res=>{
        info.value = res.data;
    })
    .catch(err=>{
        console.log(err);
    })
}


</script>
